package com.jtpay.sth0409.patternlockdemo;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

import com.jtpay.sth0409.patternlockdemo.Util.AppUtil;
import com.jtpay.sth0409.patternlockdemo.Util.ContentUtil;
import com.jtpay.sth0409.patternlockdemo.Util.SPUtils;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        String s = SPUtils.getInstance(this).getPattern(ContentUtil.KEY);
        AppUtil.getInstance(this).pushAC(this);

        /**
         * 首次进入App进入设置手势密码界面
         * 之后进入手势解锁界面
         * 每次页面跳转把当前Activity存入集合方便一次性退出
         */
        if (s == null || s.equals("")) {
            //设置手势
            startActivity(new Intent(this, SampleSetPatternActivity.class));
        } else {
            //手势解锁
            startActivity(new Intent(this, SampleConfirmPatternActivity.class));
        }

    }
}
